<%
  users_per_role = {
    :current_user => User.current.id,
    :nobody => nil
  };
  @project.users_by_role.each { |role, users|
    users_per_role[role.id] = users.map { |user| user.id }
  }

  i18n_strings = I18n.backend.send(:translations)
  locale = I18n.locale

%>
<% content_for :header_tags do %>
  <%= javascript_include_tag 'hb_prototype.js', :plugin => 'issue_hot_buttons' %>
  <%= javascript_include_tag 'hot_buttons.js', :plugin => 'issue_hot_buttons' %>
  <%= stylesheet_link_tag 'hot_buttons.css', :plugin => 'issue_hot_buttons' %>
  <script type="text/javascript">
    var IssueHotButtons = {
      issue:           <%= raw @issue.to_json tags: %w(table tr td), attributes: %w(id class style)%>,
      project:         <%= raw @project.to_json %>,
      nearby_issues:   <%= raw @nearby_issues.to_json %>,
      users_per_role:  <%= raw users_per_role.to_json %>,
      settings:        <%= raw Setting['plugin_issue_hot_buttons'].to_json %>,
      i18n_strings:    <%= raw i18n_strings[locale][:issue_hot_buttons].to_json %>,
      today:           '<%= raw User.current.today %>'
    };
  </script>
<% end %>
